<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width" />
	<meta name="author" content="www.lzqcode.com" />
    <title>文章阅读</title>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="layui/css/layui.css" />
    <link rel="stylesheet" href="css/master.css" />
    <link rel="stylesheet" href="css/gloable.css" />
    <link rel="stylesheet" href="css/nprogress.css" />
    <link rel="stylesheet" href="css/blog.css" />
    <link rel="stylesheet" href="css/message.css" />
    <link rel="stylesheet" href="css/reader.css" />
    <link rel="shortcut icon" href="image/icons.ico" />

</head>
<body>
    <div class="header">
    </div>
    <header class="gird-header">
        <div class="header-fixed">
            <div class="header-inner">
                <a href="javascript:void(0)" class="header-logo" id="logo">Mr.Jin</a>
                <nav class="nav" id="nav">
                    <ul>
                        <li><a href="index.html">首页</a></li>
                        <li><a href="article.html">博客</a></li>
                        <li><a href="message.html">留言</a></li>
						<li><a href="diary.html">日记</a></li>
                        <li><a href="link.html">友链</a></li>
                    </ul>
                </nav>
                <a href="#" class="blog-user">
                    <i class="fa fa-qq"></i>
                </a>
                <a class="phone-menu">
                    <i></i>
                    <i></i>
                    <i></i>
                </a>
            </div>
        </div>
    </header>
    <div class="doc-container" id="doc-container">
        <div class="container-fixed">
            <div class="col-content" style="width:100%">
                <div class="inner">
                    <article class="article-list">
                        <input type="hidden" value="@Model.BlogTypeID" id="blogtypeid" />
                        <section class="article-item">
                            <div id="articleContent">
<!--                                <aside class="title" style="line-height:1.5;">-->
<!--                                    <h4>Java学习路线推荐</h4>-->
<!--                                    <p class="fc-grey fs-14">-->
<!--                                        <small>-->
<!--                                            作者：<a href="javascript:void(0)" target="_blank" class="fc-link">小刘</a>-->
<!--                                        </small>-->
<!--                                        <small class="ml10">围观群众：<i class="readcount">121</i></small>-->
<!--                                        <small class="ml10">更新于 <label>2020-07-1:11:20:21</label> </small>-->
<!--                                    </p>-->
<!--                                </aside>-->
<!--                                <div class="time mt10" style="padding-bottom:0;">-->
<!--                                    <span class="day">1</span>-->
<!--                                    <span class="month fs-18">7<small class="fs-14">月</small></span>-->
<!--                                    <span class="year fs-18">2020</span>-->
<!--                                </div>-->
<!--                                <div class="content artiledetail" style="border-bottom: 1px solid #e1e2e0; padding-bottom: 20px;">-->
<!--                                      这篇文章是为了介绍自己自学用过的Java视频资料。本套整合教程总共180+G，共450+小时。考虑到绝大部分视频至少要看两遍，而且视频总时长并不代表学习时长，所以零基础初学者总学习时间大约为：600小时视频时长 + 100小时理解 + 100小时练习，至少需要800小时。你可能觉得自己能一天学习8小时，实际上平均下来每天能学4小时都算厉害了。总会有各种原因，比如当天内容太难，公司聚会，要出差等等。如果周末你也是坚持学习，那么最理想状况下，6个半月就可以学完，达到工作后能被人带的水平。但我知道那其实基本不可能。我自己从完全零基础，到学C语言，到学Java，除去中间断开的两个月，已经学习10个月。当然，这和我边工作边学习，以及没有人帮我找资料有很大关系。很多时间花在找资料上了。如果你已经经历过JavaSE的洗礼，会明白，我这篇回答对现在迷茫的你份量有多重，avaSE阶段，建议完全零基础的朋友，直接看刘意老师的，辅助看毕老师的。当然，也可以都试看一下再决定，每个人喜好不同。放心，完全零基础的朋友，一遍肯定学不会。所以同一套视频看两遍都算少了。另外，有时一个老师的观点是片面的，要结合不同老师的讲解才可能对一个知识点有更全面深刻的理解（前提是先把一个老师的讲解吃透）。所以我是建议刘意和毕向东的都至少看两遍。-->
<!--                                </div>-->
                            </div>
                            <fieldset class="layui-elem-field layui-field-title" style="margin-top:50px">
                                <legend>发表评论</legend>
                            </fieldset>
                            <div class="textarea-wrap message" style="text-align:initial;padding: 0px">
                                <form class="layui-form blog-editor" action="">
                                    <input type="hidden" name="articleid" id="articleid" value="@Model.ID">
                                    <div class="layui-row ">
                                        <div class=" layui-col-md4">
                                            <input type="text" name="membername" lay-verify="required" autocomplete="on" class="layui-input" placeholder="称呼（必填）">
                                        </div>
                                        <div class=" layui-col-md4">
                                            <input type="text" name="memberemail" lay-verify="required|email" autocomplete="on" class="layui-input" placeholder="邮箱（必填）">
                                        </div>
                                        <div class=" layui-col-md4">
                                            <input type="text" name="memberurl"   class="layui-input" placeholder="网址（不必填）">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <textarea name="editorContent"     lay-verify="content" id="remarkEditor" placeholder="请输入内容" class="layui-textarea layui-hide"></textarea>
                                    </div>
                                    <div class="layui-form-item layui-input-inline">
                                        <label class="layui-form-label" style="width:200px;margin-left:200px">有回复时通知我</label>
                                        <div class="layui-input-inline" style="width:100px">
                                            <input type="checkbox" checked=""  name="open" lay-skin="switch" lay-filter="switchTest" lay-text="是|否">
                                        </div>
                                        <button class="layui-btn"   id="formComment" lay-submit="formComment" lay-filter="formComment">提交评论</button>
                                    </div>
                                </form>
                            </div>
                            <ul class="blog-comment" id="blog-comment"></ul>
                        </section>
                    </article>
                </div>
                <div class="f-cb"></div>
                <div class="mt20">
                    <ul class="message-list" id="message-list">

                    </ul>
                </div>
            </div>
        </div>
    </div>
    <footer class="grid-footer">
        <div class="footer-fixed">
            <div class="copyright">
                <div class="info">
                    <div class="contact">
                        <a href="javascript:void(0)" class="github" ><i class="fa fa-github"></i></a>
                        <a href="https://wpa.qq.com/msgrd?v=3&uin=845184365&site=qq&menu=yes" class="qq" target="_blank" title="930054439"><i class="fa fa-qq"></i></a>
                        <a href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=jinbinvip@163.com" class="email" target="_blank" title="jinbinvip@163.com"><i class="fa fa-envelope"></i></a>
                        <a href="javascript:void(0)" class="weixin"><i class="fa fa-weixin"></i></a>
                    </div>
                    <p class="mt05">
                        Copyright &copy; 2021-2022 二水个人博客 All Rights Reserved V.1.0.0 苏ICP备2021026193号-1
                    </p>
                </div>
            </div>
        </div>
    </footer>
    <script src="layui/layui.js"></script>
    <script src="js/yss/gloable.js"></script>
    <script src="js/plugins/nprogress.js"></script>
    <script src="js/pagecomment.js"></script>
    <script src="js/pagemessage.js"></script>

    <script src="../js/jquery-1.7.2.min.js"></script>
    <script src="../js/ershui/common.js"></script>
    <script>NProgress.start();</script>
    <script>
        // 单击之后提交按钮不可选,防止重复提交
        var DISABLED = 'layui-btn-disabled';
        window.onload = function () {
            NProgress.done();

            var articleId = window.location.href.split("?")[1].split("=")[1];
            $('#articleid').val(articleId);
            //增加浏览次数，并返回博客详细信息
            $.ajax({
                type: "put",
                url: "/Blog/articleDetail?id="+articleId,
                dataType: 'json',
                success: function (result) {
                    var articleDetail=$('#articleContent');
                    articleDetail.html();
                    var html="";
                    if (result.code == web_status.SUCCESS) {
                        var data=result.data;
                        html+= '<section    >'+
                                '<aside class="title" style="line-height:2;">'+
                                '<h2>'+data.articleName+'</h2>'+
                                '<p class="fc-grey fs-14">'+
                                '<small class="ml10">围观群众：<i class="readcount">'+data.viewNum+'</i></small>'+
                                '<small class="ml10">更新于 <label>'+data.createTimeStr+'</label> </small>'+
                                '</p>'+
                                '</aside>'+
                                '<div class="time mt10" style="padding-bottom:0;">'+
                                    '<span class="day">'+data.day+'</span>'+
                                    '<span class="month fs-18">'+data.month+'<small class="fs-14">月</small></span>'+
                                    '<span class="year fs-18">'+data.year+'</span>'+
                                    '</div>'+
                                    '<div class="content artiledetail" style="border-bottom: 1px solid #e1e2e0; padding-bottom: 20px;">'+
                                    data.content+
                                    '<div class="f-cb"></div>';
                        articleDetail.html(html);
                    }
                }
            });
            layui.use(['form','layedit'], function() {
                var form = layui.form
                    , layer = layui.layer,
                    layedit = layui.layedit;
                //监听提交
                form.on('submit(formComment)', function (data) {
                    // 增加样式
                    $('#formComment').addClass(DISABLED);
                    // 增加属性
                    $('#formComment').attr('disabled', 'disabled');
                    var data = data.field;
                    var param = {
                        "articleId": $('#articleid').val(),
                        "memberName": data.membername,
                        "memberEmail": data.memberemail,
                        "memberUrl": data.memberurl,
                        "isNotice": data.open === 'on' ? 1 : 0,
                        "content": data.editorContent
                    }
                    //留言添加
                    $.ajax({
                        type: "post",
                        url: "/Blog/addLeaveWords",
                        dataType: 'json',
                        data: JSON.stringify(param),
                        contentType: 'application/json;charset=utf-8',
                        success: function (result) {
                            if (result.code == web_status.SUCCESS) {
                                location.reload();
                            } else {

                            }
                        }
                    });
                });

                //加载留言记录
                loadComment($('#articleid').val());

                //监听回复
                form.on('submit(formReply)', function(data){
                    var data=data.field;
                    // 增加样式
                    $(this).addClass(DISABLED);
                    // 增加属性
                    $(this).attr('disabled', 'disabled');
                    var param={
                        "articleId":$('#articleid').val(),
                        "parentId":data.targetUserId,
                        "memberName":data.membername,
                        "memberEmail":data.memberemail,
                        "memberUrl":data.memberurl,
                        "content":data.replyContent
                    }
                    //留言添加
                    $.ajax({
                        type:"post",
                        url:"/Blog/addLeaveWords",
                        dataType: 'json',
                        data:JSON.stringify(param),
                        contentType : 'application/json;charset=utf-8',
                        success:function (result) {
                            if(result.code==web_status.SUCCESS){
                                location.reload();
                            }else{

                            }
                        }
                    });
                    return false;
                });
            })
        };
    </script>
</body>
</html>
